﻿<link href="@Url.Content("~/content/activitie_detail.css")" rel="stylesheet" type="text/css" />
@model IEnumerable<PessModel.GradeRule>

@{
    ViewBag.Title = "Details";
}

<div id="m-title">
    <h2>等第规则详细信息</h2>
    <div id="m-op" class="fromSubject">

        @if ((bool)ViewBag.ShowCreateRuleButton)
        {
            if (Roles.IsUserInRole("Admin"))
            {
                using (Html.BeginForm("CopyGradeRulesFromSubject", "GradeRule", FormMethod.Post))
                {
                    <span>从学科导入规则：</span>
                    @Html.DropDownList("SubjectID", (SelectList)ViewBag.SubjectID)
                    <input type="submit" value="导入" class="u-btn" />
                    @Html.Hidden("TargetSubjectID", (int)ViewData["TargetSubjectID"])
                }
            }
            <span>&#8195;</span>@Html.ActionLink("新建", "Create", new { subjectID = ViewData["TargetSubjectID"] }, null)
        }
        <span>&#8195;</span>@Html.ActionLink("返回", "Index", new { activityID = ViewBag.ActivityID }, null)
    </div>
</div>
<fieldset class="fly-edit">
    <div class="m-sd-xx m-sd-title">
        <div class="title">
            @ViewBag.SubjectName
        </div>
        <div class="sidebd">
            <table>
                <tr>
                    @*<th>
                            @Html.DisplayNameFor(model => model.SubjectID)
                        </th>*@
                    <th style="width:200px">
                        @*@Html.DisplayNameFor(model => model.Name)*@名称
                    </th>
                    <th>
                        @*@Html.DisplayNameFor(model => model.Description)*@说明
                    </th>
                    <th style="width:100px">
                        @*@Html.DisplayNameFor(model => model.Value)*@百分比
                    </th>
                    <th style="width:100px">
                        @*@Html.DisplayNameFor(model => model.Value)*@下限分值
                    </th>
                    <th style="width:100px">
                        @*@Html.DisplayNameFor(model => model.Value)*@上限分值
                    </th>
                    <th ">
                        @*@Html.DisplayNameFor(model => model.Value)*@要求验证
                    </th>
                    <th></th>
                </tr>

                @foreach (var item in Model)
                {
                    <tr>
                        @*<td>
                                @Html.DisplayFor(modelItem => item.SubjectID)
                            </td>*@
                        <td>
                            @Html.DisplayFor(modelItem => item.Name)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Description)
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Percentage )
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Floor )
                        </td>
                        <td>
                            @Html.DisplayFor(modelItem => item.Ceiling )
                        </td>
                        <td>@Html.DisplayFor(modelItem=>item.ValidationRequired )</td>
                        <td class="thAction">
                            @if (Roles.IsUserInRole("Admin") || (bool)ViewBag.ShowCreateRuleButton)
                            {
                                @Html.ActionLink("编辑", "Edit", new { gradeRuleID = item.ID })
                                @*                @Html.ActionLink("详细", "Details", new { id=item.ID }) |*@
                                @Html.ActionLink("删除", "Delete", new { gradeRuleID = item.ID })
                            }
                        </td>
                    </tr>
                }
            </table>
        </div>
    </div>
</fieldset>